package com.up.stores.interceptor;

import org.springframework.web.servlet.HandlerInterceptor;

import javax.net.ssl.HandshakeCompletedListener;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class BussInterceptor implements HandlerInterceptor {
    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
        if (!request.getSession().getAttribute("Type").equals("Buss")) {
            response.sendRedirect("/web/user/bus.updateInfo.html");
            response.sendRedirect("/web/Product/ListProduct.html");
            response.sendRedirect("/web/Product/ShowProduct/unListProduct.html");
            response.sendRedirect("/web/Product/ShowProduct/updateProduct.html");
            response.sendRedirect("/web/address");
            return false;
        }
        return true;
    }
}
